package com.ssm.base.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;

import com.github.pagehelper.PageInfo;
import com.ssm.base.model.Page;
import com.ssm.domain.Specifications;

public interface IBaseService<T> {
	
	T selectOne(T entity);

	PageInfo<T> selectAll(Page page);

	List<T> selectAll();

	T selectByPrimaryKey(Object key);

	List<T> select(T entity);

	PageInfo<T> select(T entity,Page page);

	PageInfo<T> selectByExample(Object example,Page page);
	
	List<T> selectByExample(Object example);

	
	int selectCount(T entity);
	
	int selectCountByExample(Object example);

	int delete(T entity);

	int deleteByPrimaryKey(Object key);

	int deleteByPrimaryKeys(List<?> ids);
	
	int deleteByExample(Object example);

	int updateByPrimaryKey(T entity);
	
	int updateByExample(T entity,Object example);

	int updateByPrimaryKeySelective(T entity);
	
	int updateByExampleSelective(T entity,Object example);

	int insert(T entity) throws Exception;
	
	int insertBatch(List<T> list);

	int insertSelective(T entity);
	
}
